import request from "./request";

export const creatAd = (value: any) => {
  return request({
    method: "post",
    url: "rest/Ad",
    data: value,
  });
};

//获取广告列表数据
export const getAd = () => {
  return request({
    method: "get",
    url: "rest/Ad",
  });
};

//获取被编辑数据的详情
export const getAdMsg = (id: string[] | string) => {
  return request({
    method: "get",
    url: `rest/Ad/${id}`,
  });
};

//更新数据
export const upDateAd = (id: string | string[], data: any) => {
  return request({
    method: "put",
    url: `rest/Ad/${id}`,
    data: data,
  });
};

//删除广告
export const deletAd = (id: string | string[]) => {
  return request({
    method: "delete",
    url: `rest/Ad/${id}`,
  });
};
